package com.sd365.gateway.authorization.api;

import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;

/***
 * @Description 鉴权管理接口
 * @Date 2022/12/29 15:34
 * @Author hantianbing
 **/
@Api(tags = "鉴权管理", value = "/v1")
@RestController
@RequestMapping(value = "/v1")
public interface Authorization {
    /***
     * @Description 非公共资源鉴权判断
     * @param token 用户token
     * @param url   请求的url
     * @return java.lang.Boolean
     * @Date 2022/12/29 15:34
     * @Author hantianbing
     **/
    @ApiOperation(tags = "鉴权判断url",value = "/authorization")
    @GetMapping(value = "/authorization")
    @ResponseBody
    Boolean roleAuthorization(String token,String url) throws InterruptedException;



    /***
     * @Description 公共资源权限判断
     * @param url  请求的url
     * @return java.lang.Boolean
     * @Date 2022/12/29 15:35
     * @Author hantianbing
     **/
    @ApiOperation(tags = "开放URL查询",value = "/common/resource")
    @GetMapping(value = "/common/resource")
    @ResponseBody
    Boolean commonResource(String url) throws InterruptedException;

}
